#ifndef _____ZSSingleton_h
#define _____ZSSingleton_h

#endif
/**
 *  头文件
 */
#define ZSSingleton_h(name)  +(instancetype)shared##name;
/**
 *  并不包括init方法
 */
#if __has_feature(objc_arc) // arc
#define ZSSingleton_m(name) \
+ (instancetype)shared##name\
{\
    return [[self alloc] init];\
}\
\
+ (instancetype)allocWithZone:(struct _NSZone *)zone\
{\
    static id instance = nil;\
    static dispatch_once_t onceToKen;\
    dispatch_once(&onceToKen, ^{\
        instance = [super allocWithZone:zone];\
    });\
    \
    \
    return instance;\
}\
\
- (id)copyWithZone:(struct _NSZone *)zone\
{\
    return self;\
}
#else
#define ZSSingleton_m(name) \
+ (instancetype)shared##name\
{\
return [[self alloc] init];\
}\
\
+ (instancetype)allocWithZone:(struct _NSZone *)zone\
{\
static id instance = nil;\
static dispatch_once_t onceToKen;\
dispatch_once(&onceToKen, ^{\
instance = [super allocWithZone:zone];\
});\
\
\
return instance;\
}\
\
- (id)copyWithZone:(struct _NSZone *)zone\
{\
return self;\
}\
\
- (oneway void)release\
{\
    \
}\
\
- (instancetype)retain\
{\
    return self;\
}\
\
- (instancetype)autorelease\
{\
    return self;\
}
#endif

